$OpenBSD: patch-Scripts_sql-update-1_3_11_to_1_3_12-mysql_sh,v 1.1 2012/03/31 17:02:23 sebastia Exp $

make script sh compatible

--- Scripts/sql-update-1.3.11_to_1.3.12-mysql.sh.orig	Wed Feb 15 09:06:10 2012
+++ Scripts/sql-update-1.3.11_to_1.3.12-mysql.sh	Wed Feb 15 09:07:53 2012
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # converting c_content to text is not needed on mysql as it is already big enough (mediumtext)
 
 # this script only works with MySQL
@@ -7,9 +7,9 @@ defaultusername=$USER
 defaulthostname=localhost
 defaultdatabase=$USER
 
-read -p "Username ($defaultusername): " username
-read -p "Hostname ($defaulthostname): " hostname
-read -p "Database ($defaultdatabase): " database
+read username?"Username ($defaultusername): "
+read hostname?"Hostname ($defaulthostname): "
+read database?"Database ($defaultdatabase): "
 
 if [ -z "$username" ]
 then
@@ -26,7 +26,7 @@ then
   database=$defaultdatabase
  fi
 
-SESSIONTBL=$(su - sogo -c "defaults read sogod OCSSessionsFolderURL" | awk -F/ '{print $NF}')
+SESSIONTBL=$(defaults read sogod OCSSessionsFolderURL | awk -F/ '{print $NF}')
 if [ -z "$SESSIONTBL" ]; then
   echo "Failed to obtain session table name" >&2
   exit 1
